const mysql = require('mysql');

let pool  = mysql.createPool({
    host: 'localhost',
    user: 'root', 
    password: 'root',
    database: 'userdb'
})

function excute(sqlStr, config) {
	return new Promise((resolve, reject) => {
		pool.query(sqlStr, config, (err, results) => {
            if(err) {
                reject(err);
            }
            else {
                resolve(results);
            }
        })
	})
}

module.exports = {
    Excute: excute
}